package com.zmht.beike.biz.impl;

import java.io.Serializable;
import java.util.List;

import com.zmht.beike.biz.IWeekinfoBiz;
import com.zmht.beike.core.BaseBizImpl;
import com.zmht.beike.po.TIweekinfo;

public class IWeekinfoBizImpl extends BaseBizImpl implements IWeekinfoBiz {

	public List getIWeekInfo(Integer teacherId, int startIndex, int pageSize) {
		String hql = "from TIweekinfo t where t.teacherId="+teacherId;
		return this.getIweekinfoDAO().findByPage(hql, startIndex, pageSize);
	}

	public int getIWeekInfoTotal(Integer teacherId) {
		String hql = "from TIweekinfo t where t.teacherId="+teacherId;
		return this.getIweekinfoDAO().findByHQLObj(hql).size();
	}

	public Integer saveIWeekInfo(TIweekinfo weekinfo) {
		try{
			return (Integer)this.getIweekinfoDAO().saveObj(weekinfo);
		}catch(Exception e){
			return 0;
		}
	
	}

	public TIweekinfo findById(Serializable id) {
		
		return (TIweekinfo)this.getIweekinfoDAO().findById(TIweekinfo.class, id);
	}

	public TIweekinfo findByTarget(String targetId, String month,
			String week,Integer teacherId) {
		return this.getIweekinfoDAO().findByTarget(targetId, month, week,teacherId);
		
	}

}
